<template>
  <div class="col-xs-offset-2 col-xs-8">
    <div class="page-header">
      <h2>Vue Router Demo</h2>
      <button @click="back">后退</button>
      <button @click="forward">前进</button>
      <button @click="test">测试一下go</button>
    </div>
  </div>
</template>

<script>
export default {
  name: "Banner",
  methods: {
    back() {
      console.log(this.$router);
      this.$router.back(); // 浏览器历史路由倒退一步
    },
    forward() { 
      this.$router.forward(); // 浏览器历史路由前进一步
    },
    test() {
      this.$router.go(3); // 指定浏览器路由前进或后退指定步数
    },
  },
};
</script>
